package org.example.shop.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.example.shop.pojo.UserInfo;
import org.example.shop.vo.ApiResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/per")
public class PermissionController {

    // abc
    @RequiresPermissions(value = {"test:per:query","test:per:test"},logical = Logical.OR)
    @RequestMapping("/query")
    public String queryString() {
        return "xxx";
    }

    // bcd
    @RequiresPermissions("test:per:user")
    @RequestMapping("/query/user")
    public UserInfo queryUser() {
        return null;
    }
}
